package com.miaoji.service.impl;

import com.miaoji.domain.po.Stock;
import com.miaoji.mapper.StockMapper;
import com.miaoji.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Random;

@Service
public class StockServiceImpl implements StockService {
    @Autowired
    StockMapper stockMapper;
    @Override
    public void StockInsert(Stock stock) {
        stockMapper.insert(stock);
    }

    @Override
    public void StockUpdate(Stock stock) {
        stockMapper.updateById(stock);
    }

    @Override
    public void StockDelete(Stock stock) {
        stockMapper.deleteById(stock.getId());
    }

    @Override
    public List<Stock> StockSelect(int cloth_id) {
        return stockMapper.stockInfo(cloth_id);
    }

}
